package typejump.commands;

import typejump.Settings;
import typejump.Swagger;
import typejump.TypeJump;
import typejump.engine.GameEngine;
import typejump.objects.Actor;

public class GoRight implements TextCommand {
	
	private double basel = Settings.getDouble("go.base");
	private double mult = Settings.getDouble("go.mult");
	private double swagRatio = Settings.getDouble("go.cost");

	@Override
	public boolean matches(String command) {
		return command.toLowerCase().matches("go+");
	}

	@Override
	public void act(String command) {
		Actor player = TypeJump.getInst().getPlayer();
		
		double accel = basel + mult*Math.max(0, Swagger.getInst().expendSwag((command.length()-2) * swagRatio)) / swagRatio;
		player.accelerate(accel, 0);
		
		GameEngine.addTextEffect("GO", "go");
	}

}
